feat(01KVS11W): A Flow workspace git-ignores .claude/ so the runtime's worktrees and agent scratch never show up as untracked noise#437
Merged
jackmcintyre merged 2 commits intoJun 23, 2026
Conversation
…s worktrees and agent scratch never show up as untracked noise When /flow:init provisions a workspace, it now ensures .claude/ is git-ignored so the Claude Code runtime's per-story worktrees (.claude/worktrees/) and agent scratch never appear as untracked noise in git status. The implementation appends .claude/ to .gitignore (creating the file if absent), is idempotent when the rule already exists, and preserves all existing .gitignore rules. Tests cover both new ACs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A Flow workspace git-ignores .claude/ so the runtime's worktrees and agent scratch never show up as untracked noise
This change delivers the following acceptance criteria:
Why
As an operator initialising a Flow workspace in my own project, I want /flow:init to git-ignore .claude/ in my workspace, so that the Claude Code runtime's per-story worktrees (under .claude/worktrees/) and agent scratch do not appear as untracked noise in my git status.
How to check it yourself
Run the init-workspace tests: cd plugins/flow/mcp-server && vitest run src/tools/tests/init-workspace.test.ts. The three new tests cover: (1) .gitignore created with .claude/ rule when absent, (2) .claude/ appended without clobbering existing rules, (3) no duplication when rule already present.
Risk and blast radius
Risk tier: medium
The change is scoped to the files in the diff below. Review the diff to judge its actual blast radius — including any effect on shared state, data schemas, or authentication paths — before approving.
What is explicitly not covered: reviewer verification of this summary's accuracy is handled by a separate companion story.
Evidence
The pre-pull-request build-and-test gate passed before this pull request was opened. No pull request can be opened by the automated flow unless both
pnpm buildandpnpm testexit 0 in the developer's working directory.Per-criterion covering checks:
plugins/flow/mcp-server/src/tools/__tests__/init-workspace.test.ts(automated test)plugins/flow/mcp-server/src/tools/__tests__/init-workspace.test.ts(automated test)Story: native:01KVS11W2GGH84XQCWH79GMBQZ
Spec: .flow/native-stories/01KVS11W2GGH84XQCWH79GMBQZ.md
ACs:
feat(init): git-ignore .claude/ on workspace init (append-safe, idempotent)